#ifndef MYTCPSOCKET_H
#define MYTCPSOCKET_H

#include <QTcpSocket>

class MyTcpSocket : public QTcpSocket
{
    Q_OBJECT
public:
    explicit MyTcpSocket(QObject *parent = nullptr);
    virtual ~MyTcpSocket();

public slots:
    virtual void sendDataToAll(const QByteArray &data);
    void myAbortSlot();

signals:
    void dataSendSig(const QByteArray &data);
    void dataReceiveSig(const QByteArray &data);
    void sendDataToAllSig(const QByteArray &data);

protected slots:
    void readyReadSlot();

protected:
    virtual void handleFrame(const QJsonObject &obj) = 0;

};

#endif // MYTCPSOCKET_H
